#ifndef CHATMESSAGEITEM_H
#define CHATMESSAGEITEM_H

#include <QWidget>

class QLabel;
class QHBoxLayout;
class QVBoxLayout;

class ChatMessageItem : public QWidget
{
    Q_OBJECT
public:
    enum SenderKind { SelfSide, PeerSide };

    explicit ChatMessageItem(SenderKind sender,
                             const QString &senderName,
                             const QString &messageText,
                             QWidget *parent = nullptr);

    static QString selfBackgroundColor();
    static QString selfBorderColor();
    static QString peerBackgroundColor();
    static QString peerBorderColor();

private:
    void buildUi(SenderKind sender,
                 const QString &senderName,
                 const QString &messageText);
    QWidget *createNameBadgePlain(const QString &name);
    QWidget *createBubble(const QString &text,
                          const QString &background,
                          const QString &borderColor,
                          bool drawBorder,
                          Qt::Alignment alignment);
};

#endif // CHATMESSAGEITEM_H


